#include "mywidget.h"

myWidget::myWidget(QWidget *parent)
    : QWidget(parent)
{
    QVBoxLayout* mainLayout = new QVBoxLayout(this);


    QToolBox* toolBox = new QToolBox(this);
    mainLayout->addWidget(toolBox);

    //添加第一组：
    QToolButton* toolbtn1 = new QToolButton;
    toolbtn1->setText("Qt");
    toolbtn1->setIcon(QIcon("te.ico"));
    toolbtn1->setIconSize(QSize(32,32));
    toolbtn1->setAutoRaise(true);           //当鼠标离开的时候，按钮能够自动回复为弹起状态
    toolbtn1->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);     //ToolButtonTextBesideIcon——文字显示在图标下面

     QToolButton* toolbtn2 = new QToolButton;
     toolbtn2->setText("Cpp");
     toolbtn2->setIcon(QIcon("tui.ico"));
     toolbtn2->setIconSize(QSize(32,32));
     toolbtn2->setAutoRaise(true);           //当鼠标离开的时候，按钮能够自动回复为弹起状态
     toolbtn2->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);     //ToolButtonTextBesideIcon——文字显示在图标下面

     QToolButton* toolbtn3 = new QToolButton;
     toolbtn3->setText("Mfc");
     toolbtn3->setIcon(QIcon("tui.ico"));
     toolbtn3->setIconSize(QSize(32,32));
     toolbtn3->setAutoRaise(true);           //当鼠标离开的时候，按钮能够自动回复为弹起状态
     toolbtn3->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);     //ToolButtonTextBesideIcon——文字显示在图标下面

    QGroupBox* groupBox = new QGroupBox;
    QVBoxLayout* v1Layout = new QVBoxLayout;
    v1Layout->addWidget(toolbtn1);
    v1Layout->addWidget(toolbtn2);
    v1Layout->addWidget(toolbtn3);
    groupBox->setLayout(v1Layout);

    toolBox->addItem(groupBox,"App");




    //添加第二组:
    QToolButton* toolbtn4 = new QToolButton;
    toolbtn4->setText("Qt_too");
    toolbtn4->setIcon(QIcon("te.ico"));
    toolbtn4->setIconSize(QSize(32,32));
    toolbtn4->setAutoRaise(true);           //当鼠标离开的时候，按钮能够自动回复为弹起状态
    toolbtn4->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);     //ToolButtonTextBesideIcon——文字显示在图标下面

     QToolButton* toolbtn5 = new QToolButton;
     toolbtn5->setText("Cpp_too");
     toolbtn5->setIcon(QIcon("te.ico"));
     toolbtn5->setIconSize(QSize(32,32));
     toolbtn5->setAutoRaise(true);           //当鼠标离开的时候，按钮能够自动回复为弹起状态
     toolbtn5->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);     //ToolButtonTextBesideIcon——文字显示在图标下面

    QToolButton* toolbtn6 = new QToolButton;
    toolbtn6->setText("Mfc_too");
    toolbtn6->setIcon(QIcon("tui.ico"));
    toolbtn6->setIconSize(QSize(32,32));
    toolbtn6->setAutoRaise(true);           //当鼠标离开的时候，按钮能够自动回复为弹起状态
    toolbtn6->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);     //ToolButtonTextBesideIcon——文字显示在图标下面

    QGroupBox* groupBox2 = new QGroupBox;
    QVBoxLayout* v2Layout = new QVBoxLayout;
    v2Layout->addWidget(toolbtn4);
    v2Layout->addWidget(toolbtn5);
    v2Layout->addWidget(toolbtn6);
    groupBox2->setLayout(v2Layout);

    toolBox->addItem(groupBox2,"App_add");











}

myWidget::~myWidget()
{
}

